
package com.nancy.ioc.BeanFactoryPostProcessor.conditional;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhouguangfeng
 * @date 2020/6/2 18:35
 */
@Configuration("conditionalConfiguration")
@Conditional(BeanConfigurationCondition.class)
public class ConditionalConfiguration {

    @Bean("testConditionBean")
    public TestConditionBean testConditionBean(){
        return new TestConditionBean() ;
    }

    @Bean
    @Conditional(BeanCondition.class)
    public TestConditionBean2 testConditionBean2(){
        return new TestConditionBean2() ;
    }

}
